package com.perfma.xtest.byd;

import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.List;
import java.util.stream.Collectors;

/**
 *
 *
 * @author: junhui.si
 * @date: 2024-06-24 16:27
 **/
public class SubString {
    public static void main(String[] args) throws IOException {
//        String k = "2_jdk8_c3p0_tran 11";
//        String transactionName = k.substring(k.indexOf("_")+1);
//        System.out.println(transactionName);

        List<String> logFileList = Files.walk(Paths.get("/Users/sijunhui/Downloads/log/11"))
                .filter(Files::isRegularFile)
                .map(Path::getFileName)
                .map(Path::toString)
                .filter(fileName -> fileName.contains("common-default.log") || fileName.contains("common-error.log"))
                .collect(Collectors.toList());
        logFileList.forEach(System.out::println);
    }
}
